function Frozen(constructor: Function) {
  Object.freeze(constructor);
  Object.freeze(constructor.prototype);
}

function ApiDocumnet(value: string) {
  return function (target: Function) {
    target.prototype.description = value;

    target.prototype.getInfo = function () {
      return new Date().toDateString();
    }
  }
}

@Frozen
@ApiDocumnet('测试2')
class IceCream { }

let iceCream = <any>new IceCream();

console.log(iceCream.version, iceCream.description, iceCream.getInfo());


function enumerable(value: boolean) {
  return function (target: any, propertyKey: string, descriptor: PropertyDescriptor) {
    descriptor.configurable = value;
  }
}

class Greeter {

  @enumerable(true)
  greet() {
    return 'hello !';
  }
}

let g1 = new Greeter();
let g2 = new Greeter();

console.log(g1.greet(), g2.greet());